﻿Public Class frmAgregarMedico

    Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click
        If Me.txtNombres.EditValue IsNot Nothing And Me.txtApellidos.EditValue IsNot Nothing Then
            Me.MedicoTableAdapter.Insert(Me.txtNombres.EditValue.ToString, Me.txtApellidos.EditValue.ToString)
            MessageBox.Show("Se ha agregado el médico correctamente a los registros", varTitulo, MessageBoxButtons.OK, MessageBoxIcon.Information)
            Me.Dispose()
            Me.Close()
        Else
            MessageBox.Show("¡No se han ingresado todos los datos!, Llene los datos faltantes e intentelo de nuevo.", varTitulo, MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

    Private Sub btnCerrar_Click(sender As Object, e As EventArgs) Handles btnCerrar.Click
        Me.Dispose()
        Me.Close()
    End Sub

    Private Sub frmAgregarMedico_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class